package edu.hncj.seckill.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author anorak
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    /**
     * 表示返回结果状态
     */
    private String status;
    /**
     * 表示返回结果码
     */
    private Integer code;
    /**
     * 返回的相关数据
     */
    private Object data;

    public static Result create(Object data){
        return create(data,"success",200);
    }

    public static Result create(Object data,String status,Integer code){
        Result result = new Result();
        result.setData(data);
        result.setStatus(status);
        result.setCode(code);
        return result;
    }

}
